package com.example.uCenter.admin.controller;

import com.example.uCenter.admin.entity.AdminUser;
import com.example.uCenter.admin.service.AdminUserService;
import com.example.uCenter.common.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 前端控制器
 *
 * @author xxs
 * @since 2022-08-27 08:20:38
 */
@CrossOrigin
@RestController
@RequestMapping("/UCenter")
public class AdminUserController {

    @Autowired
    AdminUserService adminUserService;

    @PostMapping("/adminUser")
    public Result findAdminNameAndAdminPwd(@RequestBody AdminUser adminUser) {

        return adminUserService.findAdminNameAndAdminPwd(adminUser.getAdminName(), adminUser.getAdminPwd());
    }

    @GetMapping("/adminUserPaging")
    public Result UserPaging(@RequestParam Integer current, @RequestParam Integer size) {
        return adminUserService.findPaging(current,size);
    }
}

